package GiaoHangVietNam.Entities;

import java.io.Serializable;

public class GoodsInfor implements Serializable {
	public int ID;
	public String GoodsName;
	public int Cost;
	public int Fee;

	public GoodsInfor(String raw) {

		String[] fields = raw.split(";");
		if (fields.length == 4) {
			ID = Integer.parseInt(fields[0]);
			GoodsName = fields[1];
			Cost = Integer.parseInt(fields[2]);
			Fee = Integer.parseInt(fields[3]);
		}
	}

	public GoodsInfor(String[] fields) {
 
		if (fields.length == 4) {
			ID = Integer.parseInt(fields[0]);
			GoodsName = fields[1];
			Cost = Integer.parseInt(fields[2]);
			Fee = Integer.parseInt(fields[3]);
		}
	}
	public GoodsInfor(String[] fields,Boolean isAdd) {
		 
		if (fields.length == 5) {
			ID = Integer.parseInt(fields[1]);
			GoodsName = fields[2];
			Cost = Integer.parseInt(fields[3]);
			Fee = Integer.parseInt(fields[4]);
		}
	}
	public GoodsInfor(GoodsInfor other)
	{
		this.ID = other.ID;
		this.GoodsName = other.GoodsName;
		this.Cost =other.Cost;
		this.Fee = other.Fee;
	}
}
